The following invention relates to a system and method for providing information and, in particular, to a system for serving dynamic content in a web environment.
Prior art techniques exist for presenting content to a requesting client browser. A particular technique implements a Model-View-Controller (“MVC”) architecture that separates the presentation of content from the actual application data. In the MVC architecture, a model component represents the application data and methods that operate on that data. A view presents the data to a requesting user. A controller component translates user actions into operations on the model. The model component, in turn, updates the view to reflect changes to data.
Referring now to FIG. 1, there is shown a system 1 that employs a Model 2 MVC architecture for presenting dynamic content to a requesting web browser using JavaServer Pages (“JSP”) technology. JSP technology facilitates the separation of the user interface from content generation thereby enabling designers to change the overall page layout without altering the underlying dynamic content (see http://java.sun.com/products/jsp/.)
In particular, a request for a particular web page is initially submitted by a client browser 11 to a controller 12. Controller 12 includes a dispatcher 13 that identifies the requesting user, determines the page being requested, establishes the context of the request and invokes one of a plurality of business logic handlers 14 to process the request. The selected business logic handler then initiates the processing required to satisfy the client's page request including interacting with backend systems to retrieve or modify some persistent state. When the processing is completed, the business logic handler then creates and/or modifies state data 15 that is stored by a model component 16. Business logic handler then passes control back to controller 12.
Controller 12 then determines which of a plurality of JSPs 18, maintained by a view component 17, to invoke for presenting the results to the requesting client. The selected one of JSPs 18 then renders the requested page as HTML. In the event the selected one of JSPs 18 requires application data for inclusion in the page, it extracts such data directly from state data 15 maintained by model component 16 that has previously been setup by one of business logic handlers 14. Once the page is rendered, the selected one of JSPs 18 presents the page to the requesting client browser for display.
Typically, there is a single instance of the controller per each web application that services all requests for pages from the web application. In order to handle multiple simultaneous requests, the controller multi-threads so that multiple client requests can be processed concurrently.
A drawback exists with respect to the prior art Model 2 architecture in that each page that is to be served by the web application requires a unique business logic handler for processing state data and a unique JSP for presenting the resulting page to the requesting client browser. Requiring a unique business logic handler and JSP for each web page drastically increases the development effort required to create and maintain a web-based application, especially as the number of web pages to served by the application is large. Furthermore, because different business logic handlers and different JSPs that perform similar tasks, albeit for different pages, may be written by different developers, inconsistencies and errors may easily occur. In addition, because similar program code may replicated across numerous business logic handlers and JSPs that perform similar tasks, updating such code is time-consuming and prone to error. Thus, because the prior art Model 2 architecture requires a significant amount of code sharing between different business logic handlers and different JSPs, the development and maintenance of the prior art architecture is costly and inefficient.
Accordingly, its is desirable to provide an architecture for serving dynamic content that improves the efficiency and reduces the overhead costs associated with prior art architectures.